import { request } from '@/api/auth'




export const createRole = (data: {}) => {
    return request.post("/role/create", data)
}

export const updateRole = (role_id: number, data: {}) => {
    return request.put(`/role/${role_id}/update`, data)
}

export const deleteRole = (role_id: number) => {
    return request.delete(`/role/${role_id}/delete`)
}

export const listRole = (query: {}) => {
    return request.get("/role/list", { params: query })
}

export const setRolePermission = (data: {}) => {
    return request.post("/role/permission", data)
}

export const listRolePermission = (role_id: number) => {
    return request.get(`/role/${role_id}/permission`)
}